<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Yansongda\Pay\Pay;
//use Monolog\Logger;
use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //解决数据迁移的问题
        Schema::defaultStringLength(191);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //支付宝
        $this->app->singleton('alipay', function(){
            return Pay::alipay(config('pay.alipay'));
        });
        //微信支付
        $this->app->singleton('wechat_pay', function(){
            return Pay::wechat(config('pay.wechat_pay'));
        });
    }
}
